home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Tele / S / SmartClone.3.cpt / SmartClone 0.3.rsrc / STR#_1011.txt < prev    next >
Encoding:
Text File  |  1988-08-22  |  3.5 KB  |  185 lines

  1. SERVICE:               COMMAND KEY: ?
  2.  
  3. IF Service <> "" THEN ‚àÇ
  4.  
  5.     DBoxSay = "You cannot configure your modem while logged on to " & Service & "." & ‚àÇ
  6.  
  7.         "  Are you sure you want to log off?": ‚àÇ
  8.  
  9.     DBox 2: ‚àÇ
  10.  
  11.     IF DBoxResult% = CANCEL% THEN DOMONITOR:END ‚àÇ
  12.  
  13.     ELSE ‚àÇ
  14.  
  15.         DOLOGOFF: ‚àÇ
  16.  
  17.         IF ResultCode% <> 0 THEN ‚àÇ  ' check for errors executing "DO FILE"
  18.  
  19.             badFile = Service: ‚àÇ
  20.  
  21.             badLabel = "LogOff": ‚àÇ
  22.  
  23.             GOSUB doFileError: ‚àÇ
  24.  
  25.             END
  26.  
  27. IF (@modemFile = "") OR (NOT Exists%(ServiceFpath & @modemFile)) THEN ‚àÇ
  28.  
  29.     GOSUB getModemFile
  30.  
  31. DO FILE @modemFile "Configure"
  32.  
  33. IF ResultCode% <> 0 THEN ‚àÇ      ' check for errors executing "DO FILE"
  34.  
  35.     badFile = @modemFile: ‚àÇ
  36.  
  37.     badLabel =  "Configure": ‚àÇ
  38.  
  39.     GOSUB doFileError
  40.  
  41. END
  42.  
  43.  
  44.  
  45. getModemFile: 'gets name of modem file and stores it in variable @modemFile
  46.  
  47.     HOLD ON
  48.  
  49.     Message = ""
  50.  
  51.     prompt1 = "Please select the modem file:"
  52.  
  53.     fileType1 = "SERV"
  54.  
  55.     HOLD OFF
  56.  
  57.     modemFile = GetFile(prompt1,fileType1,ServiceFPath)
  58.  
  59.     IF (ResultCode% = 100) OR (DBoxResult% = CANCEL%) THEN END
  60.  
  61.     HOLD ON
  62.  
  63.     CURSOR WATCH
  64.  
  65.  
  66.  
  67.     'parse the path from string returned by GetFile
  68.  
  69.     myPath = modemFile
  70.  
  71.     lastColon% = 0
  72.  
  73. getLastColon:
  74.  
  75. '{RTV - 5/19/88 A faster colon parser}
  76.  
  77.     IF InStr%(lastColon%+1, myPath, ":") <> 0 THEN ‚àÇ
  78.  
  79.         lastColon% = InStr%(lastColon%+1, myPath, ":"): GOTO getLastColon
  80.  
  81.  
  82.  
  83.     myPath = Left(myPath,lastColon%)
  84.  
  85.     modemFile = Mid(modemFile, lastColon%+1)
  86.  
  87.  
  88.  
  89.     ServiceFPath = myPath   ' set ServiceFPath to path returned by GetFile
  90.  
  91.     DO FILE modemFile "Identify"
  92.  
  93.     IF (ResultCode% <> 0) THEN ‚àÇ
  94.  
  95.         IF (ResultCode% <> 106) THEN ‚àÇ          ' bad label error
  96.  
  97.             badFile = modemFile: ‚àÇ              ' 106 is "label not found" error
  98.  
  99.             badLabel = "Identify": ‚àÇ
  100.  
  101.             GOSUB doFileError: ‚àÇ
  102.  
  103.             CURSOR RESET: ‚àÇ
  104.  
  105.             END ‚àÇ
  106.  
  107.         ELSE Message = "NotModem"               ' coerce dbox for error #106
  108.  
  109.  
  110.  
  111.     ' check for if modemFile is really a modem file
  112.  
  113.     IF UpCase(Message) <> "MODEM" THEN ‚àÇ
  114.  
  115.         DBoxSay = modemFile & " does not appear to be a modem file.  " & ‚àÇ
  116.  
  117.             "An example of a modem file for Apple and " & ‚àÇ
  118.  
  119.             "Hayes-compatible modems is ""Hayes Modem.""  Try again?": ‚àÇ
  120.  
  121.         HOLD OFF: ‚àÇ
  122.  
  123.         DBOX 2: ‚àÇ
  124.  
  125.         IF DBoxResult% = OK% THEN GOTO getModemFile ‚àÇ
  126.  
  127.         ELSE CURSOR RESET: END
  128.  
  129.     @modemFile = modemFile  ' put new modem file in lookup table
  130.  
  131.     HOLD OFF
  132.  
  133.     CURSOR RESET
  134.  
  135.     Message = ""            ' routine was successful
  136.  
  137.     RETURN
  138.  
  139.  
  140.  
  141. doFileError:
  142.  
  143.     ' alert user
  144.  
  145.     BELL:BELL
  146.  
  147.     ' Give user a description of error
  148.  
  149.     IF ResultCode% = 106 THEN DBoxSay = "Cannot find the label """ & badLabel & ‚àÇ
  150.  
  151.         """ in the file """ & badFile & """.  Program aborted." ‚àÇ
  152.  
  153.     ELSE IF ResultCode% = -108 THEN DBoxSay = ‚àÇ
  154.  
  155.         "Not enough memory to open the file """ & ‚àÇ
  156.  
  157.         badFile & """.  Program aborted." ‚àÇ
  158.  
  159.     ELSE IF ResultCode% = -49 THEN ‚àÇ
  160.  
  161.         DBoxSay = "Cannot open the file """ & badFile & ‚àÇ
  162.  
  163.         " because it is already open for writing.  Program aborted." ‚àÇ
  164.  
  165.     ELSE DBoxSay = "The following error occurred during a call to """ & badLabel & ‚àÇ
  166.  
  167.         """ in the file """ & badFile & """:  Macintosh error result code = " & ‚àÇ
  168.  
  169.         ResultCode% & ".  Program aborted."
  170.  
  171.     DBOX 1
  172.  
  173.     RETURN
  174.  
  175.  
  176.  
  177. Interrupt:
  178.  
  179.     BELL
  180.  
  181.     DISPLAY "^M^JPlease wait..."
  182.  
  183.     RETURN
  184.  
  185.